package com.z6school.manage.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.z6school.manage.common.pojo.CurrScore;
import com.z6school.manage.common.pojo.ScoreVo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;


import java.util.List;

public interface ScoreMapper  {

    List<CurrScore> findCurrScoreById(Integer studentId);


    @Update("update score set score=#{score} where studentId=#{studentId} and currId=#{currId}")
    void updateBySidCid(@Param("studentId") Integer studentId, @Param("currId")Integer currId,
                        @Param("score") Double score);

    @Select("select studentId from score")
    List<Integer> findStudentIds();
    @Insert("insert into score (id,studentId,currId,score) values (null,#{studentId},#{currId},#{score}) ")
    void addScore(@Param("studentId") Integer studentId,@Param("currId")Integer currId, @Param("score")Double score);
}
